package com.scalar.chiptrack.sales.actions.quote;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;

/**
 * User: Ganesh
 * Date: May 13, 2008
 * Time: 5:36:29 PM
 */
public class PreviousQuotationLatestPriceSearchSortCommand extends PreviousQuotationLatestPriceBaseSearchAction

{

    public ActionForward executeCommand( ActionMapping mapping,
                                           ActionForm form,
                                           HttpServletRequest request,
                                           HttpServletResponse response ) throws IOException, ServletException {
          ActionForward actionForward = null;

          try
          {
              actionForward = sort(mapping,form,request,response);
          }
          catch(Exception e)
          {
              e.printStackTrace();
              //actionForward = mapping.findForward(IActionForward.PCN_ERROR_PAGE);
          }
          return actionForward;
      }

    /**
     * filters here have some lists
     * tries to retrieve them either form request if present or queries
     * it from the db
     * @param mapping ActionMapping
     * @param form ActionForm
     * @param request HttpServletRequest
     * @return ActionForward
     */
    public ActionForward initFilters(ActionMapping mapping, ActionForm form,
                                     HttpServletRequest request)
    {
/*
        PCNUserRoleSearchActionForm createActionForm = (PCNUserRoleSearchActionForm)form;
        PCNUserRoleSearchFilterBean roleBean = new PCNUserRoleSearchFilterBean();
        roleBean.setRoleNameFilterList(getNameSearchFilterList());
        createActionForm.setSearchFilterBean(roleBean);
*/
        return new ActionForward(mapping.getInput());
    }
}